﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Login : System.Web.UI.Page
{
    ManejoUsuarios _mu;
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["username"] = "Guest";
        if (Session["username"].ToString() != "") {
            Session["username"] = "";
        }
    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        _mu = new ManejoUsuarios();
        if (_mu.Autenticacion(txtUsu.Text, txtPass.Text)) {
            Session["username"] = txtUsu.Text;
            Response.Redirect("DefaultAdmin.aspx");
        }
        lblMensaje.Text = "Verificar datos e intentar de nuevo";
    }
}